//
//  UIBarButtonItem+CNAddNewAddressUIBarButtonItem.m
//  BeeQuick_19
//
//  Created by 赵玉忠 on 16/9/24.
//  Copyright © 2016年 CN Team. All rights reserved.
//

#import "UIBarButtonItem+CNAddNewAddressUIBarButtonItem.h"

@implementation UIBarButtonItem (CNAddNewAddressUIBarButtonItem)
+(UIBarButtonItem *)loadNewUIBarButtonItemWithButtonName:(NSString *)buttonName withUIColor:(UIColor *)color andWithTarget:(id)target andAction:(SEL)action{

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.size = CGSizeMake(50, 40);
    btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    btn.titleEdgeInsets = UIEdgeInsetsMake(5, 5, 5, 5);
    [btn setTitle:buttonName forState:UIControlStateNormal];
    [btn setTitleColor:color forState:UIControlStateNormal];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return [[UIBarButtonItem alloc]initWithCustomView:btn];
}
@end
